﻿<UserControl x:Class="ParitorWPF.XPSDocumentViewer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ann="clr-namespace:System.Windows.Annotations;assembly=PresentationFramework" Width="618.827" Focusable="False" Name="XPSDocumentViewer">

    <UserControl.Resources>
        <Style 
      x:Key="MyDVStyleReplace"
      TargetType="{x:Type DocumentViewer}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DocumentViewer}">
                        <Grid>
                            <Border BorderThickness="10">
                                <Border.BorderBrush>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="Yellow" Offset="0" />
                                            <GradientStop Color="Red" Offset="0.25" />
                                            <GradientStop Color="Blue" Offset="0.75" />
                                            <GradientStop Color="LimeGreen" Offset="1" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                                <ScrollViewer Name="PART_ContentHost">
                                    <ScrollViewer.Background>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Color="Yellow" Offset="0" />
                                                <GradientStop Color="Green" Offset="1" />
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </ScrollViewer.Background>
                                </ScrollViewer>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>


    <DockPanel>
        <!-- BODY:DocumentViewer -->
        <Grid DockPanel.Dock="Top"  >
            <!--DocumentViewer Name="docViewer"  Style="{StaticResource MyDVStyleReplace}"-->
            <DocumentViewer Name="docViewer" Margin="0,0,8.5,5">
                    <DocumentViewer.ContextMenu>
                    <ContextMenu>
                        <MenuItem Command="ApplicationCommands.Copy" />
                        <Separator />
                        <!-- Add a Highlight annotation to a user selection. -->
                        <MenuItem Command="ann:AnnotationService.CreateHighlightCommand" Header="Add Highlight" />
                        <!-- Add a Text Note annotation to a user selection. -->
                        <MenuItem Command="ann:AnnotationService.CreateTextStickyNoteCommand" Header="Add Text Note" />
                        <!-- Add an Ink Note annotation to a user selection. -->
                        <MenuItem Command="ann:AnnotationService.CreateInkStickyNoteCommand" Header="Add Ink Note" />
                        <Separator />
                        <!-- Remove Highlights from a user selection. -->
                        <MenuItem Command="ann:AnnotationService.ClearHighlightsCommand" Header="Remove Highlights" />
                        <!-- Remove Text Notes and Ink Notes from a user selection. -->
                        <MenuItem Command="ann:AnnotationService.DeleteStickyNotesCommand" Header="Remove Notes" />
                        <!-- Remove Highlights, Text Notes, Ink Notes from a selection. -->
                        <MenuItem Command="ann:AnnotationService.DeleteAnnotationsCommand" Header="Remove Highlights &amp; Notes" />
                    </ContextMenu>
                </DocumentViewer.ContextMenu>

            </DocumentViewer>
        </Grid>

    </DockPanel>

</UserControl>
